package org.nf.shopping.service.Impl;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.nf.shopping.entity.Picture;
import org.nf.shopping.mapper.PictureMapper;
import org.nf.shopping.service.PictureService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author czl
 * @Date 2024-12-27
 */
@Service
@RequiredArgsConstructor
public class PictureServiceImpl implements PictureService {

    private final PictureMapper pictureMapper;

    @Override
    public PageInfo<Picture> listPicture(Integer pageSize, Integer pageNum, String name) {
        List<Picture> list = pictureMapper.listPicture(pageSize,pageNum,name);
        PageInfo<Picture> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void updatePicture(Picture picture) {
        pictureMapper.updatePicture(picture);
    }

    @Override
    public void delonePicture(Integer id) {
        pictureMapper.delonePicture(id);
    }

    @Override
    public void addPicture(Picture picture) {
        pictureMapper.addPicture(picture);
    }

    @Override
    public List<Picture> getPictureList() {
        return pictureMapper.getPictureList();
    }
}
